<?php
session_start();
require "../../../global.php";//$dirname."/".
require RootDir."/"."inc/config.php";
require RootDir."/"."inc/Uifunction.php";
require RootDir."/".$SystemConest[1]."/system/Config.php";
require RootDir."/".$SystemConest[1]."/UIFunction/adminClass.php";
require RootDir."/".$SystemConest[1]."/system/menusys/function.php";
require RootDir."/".$SystemConest[1]."/system/classsys/function.php";
require RootDir."/".$SystemConest[1]."/system/log/addlog.php";

$mydb=new YYBDB();
$TableName=reTableName($mydb,$MenuId);
CheckRule($MenuId,$mydb,$TableName,"");//检查登陆权限

$sql="select ".$SystemTablename[2]."10 from ".DQ.$SystemTablename[2]." where ".$SystemTablename[2]."0=".$MenuId;
$rsc=$mydb->db_query($sql);
if($rs=$mydb->db_fetch_array($rsc)){
	$Configother=explode(",",$rs[$SystemTablename[2]."10"]);
	
}


?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除信息</title>
<link href="../../Inc/Css.css" rel="stylesheet" type="text/css" />
</head>

<body>
<?
$MenuId=$_REQUEST["MenuId"];
$PMID = $_REQUEST["PMID"];
$OwerID=$_REQUEST["OwerID"];
$ID=$_REQUEST["ID"];
if(strlen($MenuId)<1)
{
	$MenuId=-1;
}

//权限控制
CheckRule($MenuId,$mydb,$TableName,"Del");//检查登陆权限

$turngotourl=$Configother[6];
if(strlen($turngotourl)>7){
	$turngotourl=str_replace("{MenuId}",$MenuId,$turngotourl);
	$turngotourl=str_replace("{PMID}",$PMID,$turngotourl);
	$turngotourl=str_replace("@",$ID,$turngotourl);
}
else{
	$turngotourl="/".$SystemConest[1]."/system/".$TableName."/Index.php?MenuId=$MenuId&PMID=". $_REQUEST["PMID"]."&CurrPage=" .$_REQUEST["CurrPage"].""	;
}



	$myFields[0]=$ID;
	$mydb->TableName=$TableName;
	$mydb->ArrFields=$myFields;
	$mydb->Delete();
	if($mydb->Returns >0)
	{
		addlog($mydb,$_SESSION["Login"][1],"删除".$TableName."记录id".$ID);//添加日志功能
		MessgBox("/".$SystemConest[1]."/Iamges/Right.jpg","删除成功！",$turngotourl) ;	
	}
	else
	{
		MessgBox("/".$SystemConest[1]."/Iamges/Error.jpg","删除失败！",$turngotourl) ;	
	
	}
?>

</body>
</html>